package com.heima.admin.controller.v1;

import com.heima.admin.service.AdminChannelService;
import com.heima.model.admin.dtos.SensitiveDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Psycho
 * @create 2022-05-02-15:51
 */
@RestController
@RequestMapping("wemedia/api/v1/channel")
public class AdminChannelController {

    @Autowired
    private AdminChannelService adminChannelService;



    /**
     * 查询敏感词
     * @param dto
     * @return
     */
    @PostMapping("/list")
    public ResponseResult listChannels(@RequestBody SensitiveDto dto){
        return adminChannelService.listSensitives(dto);
    }

    /**
     * 删除某个敏感词
     * @param id
     * @return
     */
    @GetMapping("/del/{id}")
    public ResponseResult deleteOneSensitive(@PathVariable("id") Integer id){
        return adminChannelService.deleteOneSensitive(id);
    }
}
